<template>
   
    
    <div class="agreechange">
        <div class="fan" @click="router.go(-1)"><button @click="edit">保存</button></div>
         <div class="fan" @click="router.go(-1)"><button>返回</button></div>
    <div>姓名：&nbsp;&nbsp;&nbsp;<input type="text" placeholder="请输入修改姓名" v-model="name" ></div>
    <div>电话:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" placeholder="请输入修改电话" v-model="phone"></div>
    <div>地址:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" placeholder="请输入地址" v-model="address"></div>
    <div>合同类型:<input type="text" placeholder="请输入合同类型" v-model="email"></div>

    </div>
</template>

<script setup>
import axios from 'axios';
import { useRoute, useRouter } from 'vue-router';
import {onMounted, ref} from 'vue'
       var route = useRoute();
       var router = useRouter();
    //    var b = ref({})

let name = ref('');
let phone = ref('');
let address = ref('');
let email = ref('');
name.value = route.query.name;
phone.value = route.query.phone;
address.value = route.query.address;
email.value = route.query.email;

var edit = ()=>{
    axios.post('api/user/editlist',{
        id:route.query.id,
        name:name.value,
        phone:phone.value,
        address:address.value,
        email:email.value,

    }).then((res)=>{
        // newlookarr.value= res.data;
        router.push('/index/agreement')
        // console.log(res.data)
        // alert("保存成功")
    })
}
       
</script>

<style>
     .agreechange input{
          width: 400px;
          height: 30px;
          margin: 15px 0;
     } 
     .fan{
         float: right;
         padding: 10px;
     }
</style>